package com.lj.ljminsu.service.impl;

import com.lj.ljminsu.bean.TjUser;
import com.lj.ljminsu.dao.UserDao;
import com.lj.ljminsu.service.IUserDaoService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class UserDaoServiceImpl implements IUserDaoService {
    @Resource
    private UserDao userDao;

    @Override
    public void addUser(TjUser tjUser) {
        userDao.addUser(tjUser);
    }

    @Override
    public String checkPhone(String userPhone) {
        String existPhone = userDao.checkPhone(userPhone);
        return existPhone;
    }

    @Override
    public TjUser selectUserByUserPhone(String userPhone) {
        TjUser tjUser = userDao.selectUserByUserPhone(userPhone);
        return tjUser;
    }

    @Override
    public TjUser selectUserByUserEmail(String email) {
        TjUser tjUser = userDao.selectUserByUserEmail(email);
        return tjUser;
    }

    @Override
    public String checkUserByEmail(String email) {
        String existEmail = userDao.checkUserByEmail(email);
        return existEmail;
    }

    @Override
    public TjUser selectUserByUserAccount(String account) {
        TjUser tjUser = userDao.selectUserByUserAccount(account);
        return tjUser;
    }

    @Override
    public void updatePasswordByUserPhone(String password, String userPhone) {
        userDao.updatePasswordByUserPhone(password,userPhone);
    }


}
